package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.query.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {

    void insert(Employee entity);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    void updateByPrimaryKey(Employee entity);

    void resetpassword(Employee entity);

    void changState(Long id);

    Integer query4Count(EmployeeQueryObject qo);

    List<Employee> query4List(EmployeeQueryObject qo);

    void deleteRelationWithRole(Long employeeId);

    void buildRelationWithRole(@Param("employeeId") Long employeeId,@Param("roleId") Long roleId);

    Employee getEmployeeByUsername(String username);
}